1. Field of the Invention
The present invention relates to a control device which controls an external memory device of a computer system, and more particularly, to a control device of this kind which stores a minimum unit of write or read data in a unit storage area together with identification information.
2. Description of the Prior Art
A control device which controls an external memory device is provided between a host system, namely, a central processing unit (CPU) and the external memory device, and performs the control for writing of data to the external memory device, and reading of data from the external memory device, under the control of the host system.
In a magnetic disk device which is a representative external memory device, a unit storage area on a magnetic disk for storing a smallest unit of write or read data is called a sector. Identification information, which is stored in the sectors, comprises a head number which specifies a magnetic head that accesses the storage surface to which the sectors belong, a track number which specifies each track on the storage surface, and a sector number which identifies one of a large number of sectors contained in each of the tracks.
In writing or reading data of the smallest unit (referred to as a unit data hereinafter), a magnetic disk control device first selects the magnetic head and the track corresponding to a sector designated by the host system, and instructs the magnetic disk device so as to read the sector identification information from the designated sector by driving the magnetic head to the selected track. The magnetic disk control device discriminates whether or not the sector number among the sector identification information that was read out coincides with the sector number designated by the host system, and carries out a processing such as write or read of a unit data to the sector if they coincide with each other, and controls the magnetic disk device so as to read the identification information of the adjacent sector if they do not coincide.
In the magnetic disk device, write or read of a unit data is ordinarily carried out for a plurality of sectors of at least one track by one request for processing. In the prior art magnetic disk control device, first, the sector number of the starting point of a processing such as writing or reading (referred to as a processing hereinafter) for the track is stored in a first register and the number of sectors to be processed or the sector number of the completion point of the processing is stored in a second register. If the sector number that is read out and the stored contents of the first register, that is, the sector number of the starting point of the processing, are found to be coincident with each other upon comparison, the magnetic disk device is controlled so as to read the sector number of the next sector after performing the processing for that sector, and the stored contents of the first register is updated with the sector number of the next sector. Further, if the stored contents of the second register is the number of sectors including objects (data) to be processed, the number is decremented by one.
If the sector number that is read out does not coincide with the stored contents of the first register, the magnetic disk device is controlled so as to read the sector number of the next sector without performing the processing for that sector.
When, after repetition of a series of the above-mentioned steps, the number of sectors including objects (data) to be processed, which is the stored contents of the second register, becomes zero (or if the stored contents of the second register is the sector number of the sector at which the processing is completed, when this sector number coincides with the sector number that is read out), the sector number that is read out signifies the sector number of the sector at which the processing is completed, so that the processing for this sector is performed, completing the processings for the track to which these sectors belong.
Since processing in the prior art magnetic disk device as described above will not be carried out until the stored contents of the first register, namely, the sector number of the processing starting point, agrees with the sector number that is read out, the state in which there occurs no processing will persist until the sector number of the starting point of the processing, which is the stored contents of the first register, is read out, even if the sector number read out first is the sector number of the sector of the object to be processed. For example, suppose that each track consists of 16 sectors which run from sector number (0) to sector number (15), the sector numbers of the objects to be processed are from (2) to (9), and the magnetic head is situated immediately in front of the sector number (6). Further, suppose that sector number (2) is stored in the first register. As the reading of the sector numbers starts, the first sector number that will be read is (6) so that the coincidence with the sector number (2) stored in the first register will not be obtained. Accordingly, the processing for sector (6) will not take place, and the sector number (7) of the next sector will be read out. However, this sector number (7) also does not coincide with the sector number (2) so that no processing will take place, and it will proceed to read the sector number of the following sector. In this manner, the state with no processing will persist for the sectors with sector numbers (8), (9), . . . , (15), (0), and (1), and the processing will take place for the first time when the sector number (2) is finally read.
As in the above, in the prior art external memory control device, there will persist the state in which no processing for the sector of the current position of the head will take place even if the head is situated at a sector which is one of the objects to be processed, so that it will take longer time for completion of the processing of one track.
The external memory devices for which control similar to the aforementioned magnetic disk control device applies include the flexible disk memory device and the optical disk memory device besides the magnetic disk device.